//
//  JSSupplyGoods.m
//  tryshopping.boss
//
//  Created by Mr.Lee on 2016/12/20.
//  Copyright © 2016年 Reabam. All rights reserved.
//

#import "JSInterfaceObj.h"

@implementation JSInterfaceObj

// 分类
- (void)skipPage1:(NSString *)str{
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(gotoFenLei:)]) {
            [self.delegate gotoFenLei:nil];
        }
        
    });
}

// 扫一扫
- (void)skipPage2:(NSString *)str{
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(gotoScan:)]) {
            [self.delegate gotoScan:nil];
        }
        
    });
}

// 搜索
- (void)skipPage3:(NSString *)str{
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(gotoSearch:)]) {
            [self.delegate gotoSearch:nil];
        }
        
    });
}

// 返回进货单
- (void)skipPage4:(NSString *)str{
    dispatch_async(dispatch_get_main_queue(), ^{
    
        if ([self.delegate respondsToSelector:@selector(gotoPurchaseOrder:)]) {
            [self.delegate gotoPurchaseOrder:nil];
        }
        
    });
}

// 商品详情
- (void)skipPage11:(NSString *)str{
    dispatch_async(dispatch_get_main_queue(), ^{
        if ([self.delegate respondsToSelector:@selector(gotoSupplyGoodsDetail:)]) {
            [self.delegate gotoSupplyGoodsDetail:str];
        }
        
    });
}

// 传递token
-(NSString *)getDataString2{
 
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *tokenId = [user objectForKey:@"tokenId"];
    return tokenId;
}

// 传递地址
-(NSString *)getDataString1{
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *getServerUrl = [user objectForKey:@"serverAddress"];
    return getServerUrl;
}


@end
